<template>
	<view>
		<z-paging ref="paging" v-model="dataList" @query="queryList">
			<view slot="top">
				<u-navbar :title="$t('my.address.listText')"  :autoBack="true" :fixed="false"></u-navbar>
			</view>
			<view class="content">
				<view v-for="(item,index) in dataList" :key="index" class="item">
					<view class="title">
						<view class="nickname">{{item.nickname}}</view>
						<view class="phone">{{item.phone}}</view>
					</view>
					<view class="address">
						<u--text :text="item.addressText" color="#666666" size="16" lineHeight="25"></u--text>
						<image src="/static/image/edit.png"></image>
					</view>
				</view>
			</view>
			<view slot="bottom">
				<view class="btn">
					<u-button :text="$t('my.address.listBtn')" shape="circle" :customStyle="btnStyle" @click="goAddress"></u-button>
				</view>
				<view class="safe_height_bottom" style="background: #fff;"></view>
			</view>
		</z-paging>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				dataList: [],
				btnStyle:{
					background:"#FFC100",
					border:"none",
					color:"#231916",
					height:"90rpx"
				}
			};
		},
		methods: {
			queryList(pageNo, pageSize) {
				this.$http.post('wanlshop/address/getaddress',{
					page:pageNo,
					limit:pageSize
				}).then(res=>{
					res.code==1 ? this.$refs.paging.complete(res.data.data) : this.$refs.paging.complete(false)
				})
			},
			goAddress(){
				uni.$u.route('/pagesA/my/addressDetail');
			}
		}
	}
</script>
<style>
	page {
		background-color: #f5f7f9;
	}
</style>
<style lang="scss" scoped>
.content{
	padding: 30rpx;
	.item{
		padding: 30rpx;
		background-color: #fff;
		border-radius: 30rpx;
		box-shadow: 5px 5px 18px 0px rgba(232,234,236,0.5100);
		margin-bottom: 20rpx;
		.title{
			display: flex;
			align-items: center;
			margin-bottom: 20rpx;
			.nickname{
				color: #141414;
				font-weight: bold;
				font-size: 34rpx;
				margin-right: 20rpx;
			}
			.phone{
				color: #989898;
				font-size: 30rpx;
			}
		}
		.address{
			display: grid;
			grid-template-columns: auto 34rpx;
			grid-column-gap: 40rpx;
			align-items: center;
			image{
				width: 34rpx;
				height: 36rpx;
			}
		}
	}
	.item:last-child{
		margin-bottom: 0;
	}
}
.btn{
	padding: 20rpx 30rpx;
	border-top-left-radius: 35rpx;
	border-top-right-radius: 35rpx;
	background-color: #fff;
}
</style>
